package org.agile4j.patterns.command.macros;

import java.io.Serializable;

public class ChopCommand implements Command, Serializable {

    private static final long serialVersionUID = 8915970531855861095L;

    /**
     * 持有具体做菜的厨师对象
     */
    private CookApi cookApi = null;

    private int tableNum;

    /**
     * 构造方法传入点菜的桌号
     *
     * @param tableNum
     */
    public ChopCommand(int tableNum) {
        this.tableNum = tableNum;
    }

    /**
     * 设置具体做菜的厨师对象
     *
     * @param cookApi
     */
    @Override
    public void setCookApi(CookApi cookApi) {

        this.cookApi = cookApi;
    }

    @Override
    public void execute() {
        this.cookApi.cook(tableNum, "绿豆排骨煲");
    }

    @Override
    public int getTableNum() {
        return this.tableNum;
    }

}
